package org.jawa.exam.model;

import org.jawa.core.cache.CacheSizes;
import org.jawa.core.cache.Cacheable;
import org.jawa.core.cache.CannotCalculateSizeException;

/**
 * 
 * 类文件: ExamDetail
 * <p>
 * <p>
 * 类描述：用户考试详情表
 * <p>
 * 作     者： migrant423
 * <p>
 * 日     期： 2012-7-16
 * <p>
 * 时     间： 下午9:18:04
 * <p>
 */
public class ExamDetail implements Cacheable {

	private static final long serialVersionUID = -4863770266367913300L;

	/**
	 * 考试编号
	 */
	private Long examId;
	/**
	 * 用户编号
	 */
	private Long userId;
	/**
	 * 试题编号
	 */
	private Long questionId;
	/**
	 * 用户答案
	 */
	private String userAnswer;
	/**
	 * 正确答案
	 */
	private String rightAnswer;
	/**
	 * 试题得分
	 */
	private double userScore;
	/**
	 * 答题时间
	 */
	private Long userTime;
	/**
	 * 试题点评
	 */
	private String userDesc;
	
	public Long getExamId() {
		return examId;
	}

	public void setExamId(Long examId) {
		this.examId = examId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getQuestionId() {
		return questionId;
	}

	public void setQuestionId(Long questionId) {
		this.questionId = questionId;
	}

	public String getUserAnswer() {
		return userAnswer;
	}

	public void setUserAnswer(String userAnswer) {
		this.userAnswer = userAnswer;
	}

	public String getRightAnswer() {
		return rightAnswer;
	}

	public void setRightAnswer(String rightAnswer) {
		this.rightAnswer = rightAnswer;
	}

	public double getUserScore() {
		return userScore;
	}

	public void setUserScore(double userScore) {
		this.userScore = userScore;
	}

	public Long getUserTime() {
		return userTime;
	}

	public void setUserTime(Long userTime) {
		this.userTime = userTime;
	}

	public String getUserDesc() {
		return userDesc;
	}

	public void setUserDesc(String userDesc) {
		this.userDesc = userDesc;
	}

	public int getCachedSize() throws CannotCalculateSizeException {
		int size = 0;
		size += CacheSizes.sizeOfObject();
		size += CacheSizes.sizeOfLong();
		size += CacheSizes.sizeOfLong();
		size += CacheSizes.sizeOfLong();
		size+=CacheSizes.sizeOfString(userAnswer);
		size+=CacheSizes.sizeOfString(rightAnswer);
		
		size+=CacheSizes.sizeOfDouble();
		size += CacheSizes.sizeOfLong();
		size+=CacheSizes.sizeOfString(userDesc);
		return size;
	}

}
